#ifndef BOOK_H
#define BOOK_H

#include <QWidget>
#include <QListWidget>
#include <QPushButton>
#include "protocol.h"
#include <QTimer>


class Book : public QWidget
{
    Q_OBJECT
public:
    explicit Book(QWidget *parent = nullptr);

    void show_file(const PDU* pdu);

    void flush_file();

    // void enter_folder(const QString &dir_name);

    QString get_str_enter_folder(); //更新当前目录

    void clear_enter_dir();


    QString get_enter_dir();

    void dir_go_back();

    QString get_go_back_dir() const;
    void setGo_back_dir(const QString &newGo_back_dir);

    QString save_path() const;

    bool download_flag() const;
    void setDownload_flag(bool newDownload_flag);

private:
    QListWidget* m_book_list_widget;
    QPushButton* m_returnPB;
    QPushButton* m_create_dirPB;
    QPushButton* m_del_dirPB;
    QPushButton* m_renamePB;
    QPushButton* m_flush_filePB;
    QPushButton* m_uploadPB;
    QPushButton* m_downloadPB;
    // QPushButton* m_del_filePB;
    QPushButton* m_share_filePB;
    QPushButton* m_move_filePB;
    QPushButton* m_select_dirPB;



    QString m_go_back_dir;
    QString m_enter_dir;

    QString m_upload_file_path;
    QTimer *m_timer;

    QString m_save_path;

    bool m_download_flag;

public:
    qint64 m_recv_total;
    qint64 m_recved;

    QString shar_file_name() const;

private:
    QString m_shar_file_name;

private:
    QString m_move_file_name;
    QString m_move_file_path;
    QString m_move_file_dest_path;



signals:
};

#endif // BOOK_H
